﻿@{
    ViewBag.Title = "报表模板";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var Cols = new Jw.Models.sys_roleMenuColumnMapService().GetCurrentUserMenuColumns();
}
@section scripts{
    <script src="~/Areas/Pacm/ViewModels/DayReport.js"></script>
    <script type="text/javascript">
        var ReportID = '@ViewBag.ReportID';
        var ReportName = '@ViewBag.ReportName';
        var CurYear = @ViewBag.CurYear;
        var CurMonth = @ViewBag.CurMonth;
        var CurDay = @ViewBag.CurDay;
        var data = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model));
        ko.bindingViewModel(new viewModel(data));
    </script>
}
<div class="z-toolbar">
    <a id="a_refresh" href="#" plain="true" class="easyui-linkbutton" icon="icon-arrow_refresh" title="刷新" data-bind="click:refreshClick">刷新</a> 
    <a id="a_add" href="#" plain="true" class="easyui-linkbutton" icon="icon-add" title="新增" data-bind="click:addClick">新增</a> 
    <a id="a_edit" href="#" plain="true" class="easyui-linkbutton" icon="icon-edit" data-bind="click:editClick" title="编辑">编辑</a>
    <a id="a_del" href="#" plain="true" class="easyui-linkbutton" icon="icon-cross" title="删除" data-bind="click:deleteClick">删除</a>
    <a id="a_audit"  href="#" plain="true" class="easyui-linkbutton" icon="icon-user-accept" data-bind="click:auditClick" title="审核">审核</a>
</div>
<div id="condition" class="container_12" style="height: 34px; padding-top: 5px;">
    <div class="grid_1 lbl">年度</div>
    <div class="grid_2 val"><input type="text" data-bind="comboboxValue:form.Info_Year,datasource:dataSource.yearsItems" class="easyui-combobox z-txt" data-options="showblank:true" /></div>
    <div class="grid_1 lbl">月份</div>
    <div class="grid_2 val"><input type="text" data-bind="comboboxValue:form.Info_Month,datasource:dataSource.monthItems" class="easyui-combobox z-txt" data-options="showblank:true" /></div>
    @if (@ViewBag.Cycle == "日报")
    {
     <div class="grid_1 lbl">天</div>
     <div class="grid_2 val"><input type="text" data-bind="comboboxValue:form.Info_Day,datasource:dataSource.dayItems" class="easyui-combobox z-txt" data-options="showblank:true" /></div>
    }
    <div class="prefix_9">
        <a id="a_search" href="#" class="button button-blue" data-bind="click:searchClick">查询</a>
        <a id="a_reset" href="#" class="button button-blue" data-bind="click:clearClick">清空</a>
    </div>
</div>
<table data-bind="datagrid:grid">
    <thead>
        <tr>
            <th field="Info_Id" sortable="true" hidden="true" align="left" width="80"> ID </th>
            <th field="Report_Name" sortable="true" align="left" width="200">报表名称 </th>
            <th field="Info_Year" sortable="true" align="center" width="60">年度</th>
            <th field="Info_Month" sortable="true" align="center" width="60">月份</th>
             @if (@ViewBag.Cycle == "日报")
             {
              <th field="Info_Day" sortable="true" align="center" width="60">日</th>
             }
            <th field="CreatePerson" sortable="true" align="left" width="80"> 创建人 </th>
            <th field="CreateDate" formatter="com.formatTime" sortable="true" align="left" width="120"> 创建时间 </th>
            <th field="UpdatePerson" sortable="true" align="left" width="80"> 更新人 </th>
            <th field="UpdateDate" formatter="com.formatTime" sortable="true" align="left" width="120"> 更新时间 </th>
            <th field="ApprovePerson" sortable="true" align="left" width="80"> 审核人 </th>
            <th field="ApproveDate" formatter="com.formatTime" sortable="true" align="left" width="110"> 审核时间</th>
            <th field="ApproveState" sortable="true" align="left" width="80"> 审核状态 </th>
        </tr>
    </thead>
</table>
<script type="text/html" id="type-template">
    <div class="container_12" style="width:90%;margin:5%;">
        <div class="grid_4 lbl">报表名称：</div>
        <div class="grid_7 val"><input id = "txtName" disabled="disabled" name = "txtName"  data-bind="value:form.txtName,readOnly:true" class="z-txt" /></div>
        <div class="grid_1 lbl"></div>
        <div class="clear"></div>
        <div class="grid_4 lbl">报表年份：</div>
        <div class="grid_7 val"><input id = "txtYear" name = "txtYear"   data-bind="value:form.txtYear,readOnly:false" class="z-txt" data-options="required:true"   /></div>
        <div class="grid_1 lbl" style="color:#F00">*</div>
        <div class="clear"></div>
        <div class="grid_4 lbl">报表月份：</div>
        <div class="grid_7 val"><input id = "txtMonth"   data-bind="value:form.txtMonth,readOnly:false" class="easyui-numberbox z-txt" data-options="min:1,max:12,required:true"  /></div>
        <div class="grid_1 lbl" style="color:#F00">*</div>
        <div class="clear"></div>
        <div class="grid_4 lbl">报表天次：</div>
        <div class="grid_7 val"><input id = "txtDay"   data-bind="value:form.txtDay,readOnly:false"  class="easyui-numberbox z-txt" data-options="min:1,max:31,required:true"  /></div>
        <div class="grid_1 lbl" style="color:#F00">*</div>
        <div class="clear"></div>
    </div>
   <div style="text-align:center;margin:5px;">
        <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" data-bind="click:confirmClick" href="javascript:void(0)"  >确定</a>  
        <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" data-bind="click:cancelClick" href="javascript:void(0)">取消</a> 
    </div>
           
</script>
